unity agent look at

109

unity agent look at -

private void FaceTarget(Vector3 destination)
{
    Vector3 lookPos = destination - transform.position;
    lookPos.y = 0;
    Quaternion rotation = Quaternion.LookRotation(lookPos);
    transform.rotation = Quaternion.Slerp(transform.rotation, rotation, [fill in desired rotation speed]);  
}

Comments

Submit
0 Comments